﻿<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>::WA_Title_Main:: - ::WA_Title_WebAdmin::</title>
        @head.html@
        <!-- [[ BUNDLE END ]] -->
        <script src="script/Strings.Server.js"></script>
        <script src="script/bootstrap-helper.js"></script>
        <script src="Index.js"></script>
    </head>
    <body>
        <div id="page-container">
            <div id="content" class="container-fluid">
                <div class="row row-offcanvas row-offcanvas-left">
                    <div class="col-xs-12 col-sm-9">

                        <h1 class="page-header">
                            ::WA_Title_Main::
                        </h1>

                        <div class="alert alert-info text-center" role="alert" data-bind="visible: NewVer">
                            <a href="#" target="external" data-bind="attr: { href: NewVerUrl }">::LaterVersionAvailable::</a>
                        </div>

                        <div class="alert alert-danger text-center" role="alert" data-bind="visible: HasFailedPlugins">
                            <span data-bind="text: FailedPluginsMessage"></span>
                        </div>

                        <div data-bsu="collapsible-panel" data-bsu-options="expanded">
                            <div>
                                ::UNC::
                            </div>
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <div class="col-sm-6">
                                        <select class="form-control" data-bind="options: AddressPerspectives, optionsText: 'description', value: SelectedAddressPerspective"></select>
                                    </div>
                                    <div class="col-sm-6">
                                        <select class="form-control" data-bind="options: AddressPages, optionsText: 'description', value: SelectedAddressPage"></select>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12">
                                        <a href="#" target="livesite" data-bind="attr: { href: AddressUrl }, text: AddressUrl"></a>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div data-bsu="collapsible-panel" data-bsu-options="expanded">
                            <div>
                                ::FeedStatus::
                            </div>
                            <div>
                                <div class="table-responsive">
                                    <table class="table table-striped table-condensed">
                                        <thead>
                                            <tr>
                                                <th class="thin-column"></th>
                                                <th>::NameTitle::</th>
                                                <th>::WA_Title_Status::</th>
                                                <th class="text-right">::WA_Title_Messages::</th>
                                                <th class="text-right">::WA_Title_Bad::</th>
                                                <th class="text-right">::WA_Title_Tracking::</th>
                                            </tr>
                                        </thead>
                                        <tbody data-bind="foreach: Feeds">
                                            <tr>
                                                <td class="thin-column">
                                                    <button type="button" class="btn btn-info btn-xs" aria-label="Feed Options" data-bind="click: $root.SelectFeed" data-toggle="modal" data-target="#feed-modal">
                                                        <span class="glyphicon glyphicon-cog"></span>
                                                    </button>
                                                </td>
                                                <td data-bind="text: Name"></td>
                                                <td data-bind="text: ConnDesc, css: StatusClass"></td>
                                                <td data-bind="text: FormattedMsgs" class="text-right"></td>
                                                <td data-bind="text: FormattedBadMsgs" class="text-right"></td>
                                                <td data-bind="text: FormattedTracked" class="text-right"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div id="feed-modal" data-bsu="modal" data-bsu-options="header-close">
                            <div>
                                <span data-bind="text: SelectedFeed().Name"></span>
                            </div>
                            <div>
                                <div class="row">
                                    <div class="col-sm-6">
                                        <button type="button" class="btn btn-info" disabled="disabled" data-bind="visible: SelectedFeed().Merged">
                                            ::StatisticsTitle:: »
                                        </button>
                                        <a class="btn btn-info" data-bind="attr: { href: SelectedFeed().StatisticsUrl, target: SelectedFeed().StatisticsTarget }, hidden: SelectedFeed().Merged">
                                            ::StatisticsTitle:: »
                                        </a>
                                    </div>
                                    <div class="col-sm-6">
                                        <button type="button" class="btn btn-info pull-right" disabled="disabled" data-bind="visible: SelectedFeed().Merged">
                                            ::ConnectorActivityLog:: »
                                        </button>
                                        <a class="btn btn-info pull-right" data-bind="attr: { href: SelectedFeed().ConnectorActivityLogUrl }, hidden: SelectedFeed().Merged">
                                            ::ConnectorActivityLog:: »
                                        </a>
                                    </div>
                                </div>
                                <hr />
                                <div class="row">
                                    <div class="col-sm-6">
                                        <button type="button" class="btn btn-danger" data-dismiss="modal" data-bind="click: $.proxy(pageHandler.resetPolarPlot, pageHandler), enable: SelectedFeed().Polar">
                                            ::WA_Label_ResetPolarPlot::
                                        </button>
                                    </div>
                                    <div class="col-sm-6">
                                        <button type="button" class="btn btn-danger pull-right" data-dismiss="modal" data-bind="click: $.proxy(pageHandler.reconnectFeed, pageHandler), disable: SelectedFeed().Merged">
                                            ::WA_Label_Reconnect::
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div data-bsu="collapsible-panel" data-bsu-options="expanded">
                            <div>
                                ::WA_Label_WebServer::
                            </div>
                            <div>
                                <div class="table-responsive">
                                    <table class="table table-striped table-condensed">
                                        <thead>
                                            <tr>
                                                <th class="thin-column">::IPAddress::</th>
                                                <th class="thin-column">::User::</th>
                                                <th class="thin-column text-right">::BytesSent::</th>
                                                <th>::LastURL::</th>
                                            </tr>
                                        </thead>
                                        <tbody data-bind="foreach: Requests">
                                            <tr>
                                                <td data-bind="text: RemoteAddr" class="thin-column"></td>
                                                <td data-bind="text: User" class="thin-column"></td>
                                                <td data-bind="text: FormattedBytes" class="thin-column text-right"></td>
                                                <td data-bind="text: LastUrl"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div data-bsu="collapsible-panel" data-bsu-options="expanded">
                            <div>
                                ::RebroadcastServersLabel::
                            </div>
                            <div>
                                <div class="table-responsive">
                                    <table class="table table-condensed table-striped">
                                        <thead>
                                            <tr>
                                                <th>::NameTitle::</th>
                                                <th>::IPAddress::</th>
                                                <th>::Port::</th>
                                                <th class="text-right">::WA_Title_Buffered::</th>
                                                <th class="text-right">::WA_Title_Sent::</th>
                                                <th class="text-right">::WA_Title_Discarded::</th>
                                            </tr>
                                        </thead>
                                        <tbody data-bind="foreach: Rebroadcasters">
                                            <tr>
                                                <td data-bind="text: Name"></td>
                                                <td data-bind="text: RemoteAddr"></td>
                                                <td data-bind="text: LocalPort"></td>
                                                <td data-bind="text: FormattedBuffered" class="text-right"></td>
                                                <td data-bind="text: FormattedWritten" class="text-right"></td>
                                                <td data-bind="text: FormattedDiscarded" class="text-right"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div data-bsu="collapsible-panel" data-bsu-options="expanded">
                            <div>
                                ::WA_Title_Upnp::
                            </div>
                            <div>
                                <p data-bind="text: UpnpStatus"></p>
                                <div>
                                    <button id="upnp-toggle" type="button" class="btn btn-info"
                                            data-bind="text: UpnpButtonText, disable: UpnpButtonDisabled, click: $.proxy(pageHandler.toggleUPnpStatus, pageHandler)"></button>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>

        <script type="text/javascript">
            $(document).on('ready', function() {
                Bootstrap.Helper.decorateBootstrapElements();
                window.pageHandler = new VRS.WebAdmin.Index.PageHandler();
            });
        </script>
    </body>
</html>